package com.kfm.base.ex;

public class Person {

    private String name;

    private Integer age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age; // age.intValue();
    }

    public void setAge(int age) throws Exception {
        if (age < 0 || age > 140){
            throw new Exception("异常"); // checked 必须处理
//            throw new RuntimeException(); // unchecked
        }
        this.age = age;
    }
}
